import Vue from 'vue'
import VueRouter from 'vue-router'

import pie from "../views/pie";
import Table from "../views/Table";
import Edit from "../views/Edit";
import Add from "../views/Add"
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Table
  },
  {
    path: '/bar',
    name: 'Bar',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/Bar.vue')
  },
  {
    path: "/pie",
    name: "pie",
    // component: () => import(/* webpackChunkName: "about" */ '../views/pie.vue')
    component: pie

  },
  {
    path: "/table",
    name: "Table",
    component: Table
  },
  {
    path: "/edit",
    name: "edit",
    component: Edit
  },
  {
    path: "/add",
    name: "add",
    component: Add
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
